import request from '@/utils/request'

export function addProduct(data) {
  return request({
    url: '/juanbusiness/product/add',
    method: 'post',
    data
  })
}

export function findProduct(page, size, upDownStatus, productCategoryId, combined) {
  return request({
    url: '/juanbusiness/product/findPage',
    method: 'get',
    params: { page: page, size: size, upDownStatus: upDownStatus, productCategoryId: productCategoryId, combined: combined }
  })
}

export function sortProduct(id, sort) {
  return request({
    url: '/juanbusiness/product/sort',
    method: 'put',
    params: {id: id, sort: sort}
  })
}

export function upDownProduct(id) {
  return request({
    url: '/juanbusiness/product/upDown',
    method: 'put',
    params: {id: id}
  })
}

export function editProduct(data) {
  return request({
    url: '/juanbusiness/product/edit',
    method: 'put',
    data
  })
}

export function detailProduct(id) {
  return request({
    url: '/juanbusiness/product/get',
    method: 'get',
    params: {id: id}
  })
}

export function delProduct(id) {
  return request({
    url: '/juanbusiness/product/del',
    method: 'delete',
    params: {id: id}
  })
}
